package s01;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author wangpp
 */
public class SampleMethodInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println(String.format("==========%s=======", "before"));
        Object result = proxy.invokeSuper(obj, args);
        System.out.println(String.format("==========%s=======", "after"));
        return result;
    }
}
